﻿package com.game.tile.model
{
    import flash.display.BitmapData;
    import flash.display.Bitmap;
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    
    public class ImageLayerVO extends LayerVO
    {
        
        public var id:int;
        public var source:String;
        public var bd:BitmapData;
        public var bp:Bitmap;
        public var displayObject:DisplayObject;
        public var image:String;
        public var repeat:int = 1;
        
        
        override public function buildFromXMLAttr(_arg_1:XML):void
        {
            super.buildFromXMLAttr(_arg_1);
            source = _arg_1.image.@source;
            repeat = this.properties.repeat;
            repeat = repeat <= 0 ? 1 : repeat;
            if (repeat <= 0) repeat = 1;
        }
        
        override public function Destroy():void
        {
            super.Destroy();
            if (bd)
            {
                bd.dispose();
            }
            bd = null;
            if (((displayObject) && (MovieClip(displayObject))))
            {
                MovieClip(displayObject).stop();
            }
            displayObject = null;
        }
    }
}

